package com.heima.user.utils;

public class AppThreadLocalUtil {

    private final static ThreadLocal<Long> WM_USER_THREAD_LOCAL = new ThreadLocal<>();

    /**
     * 添加用户id
     *
     * @param id
     */
    public static void setId(Long id) {
        WM_USER_THREAD_LOCAL.set(id);
    }

    /**
     * 获取用户id
     */
    public static Long getId() {
        return WM_USER_THREAD_LOCAL.get();
    }

    /**
     * 清理用户id
     */
    public static void remove() {
        WM_USER_THREAD_LOCAL.remove();
    }
}
